package puzzle.slilin2.view.text;

import java.io.IOException;

import puzzle.common.point.Pnt;
import puzzle.slilin2.data.SlilinBoard;

public class TextFormatter {
	private TextCellFormatter m_cf;
	private Appendable m_out;
	
	public TextFormatter(Appendable out) {
		m_out = out;
		m_cf = new TextCellFormatter(out);
	}
	
	public void format(SlilinBoard b) throws IOException {
		for (int y = 0; y < b.height; y++) {
			for (int x = 0; x < b.width; x++) {
				m_cf.format(b, new Pnt(x, y));
			}
			m_out.append("\n");
		}
	}
}
